import React,{useEffect} from 'react'
import Luo from 'iscroll-luo';
import * as action from "../action"
import {useDispatch,useSelector} from "react-redux"
import { Image } from 'react-vant'
function Home() {
 let dispacth = useDispatch()
 let store = useSelector((state)=>{
     return {
         ...state.homereducer
     }
 })
 useEffect(()=>{
    dispacth(action.getpulllist())
 },[])
 let onUp = ()=>{
    dispacth(action.getpulllist())
 }

  return (
    <div style={{ position: 'relative', height: '100vh' }}>
           <button>跳转</button>
  			<Luo
  				id='id'
  				
            			onUp={onUp}
  			>
  				{
      			    store.arr && store.arr.length ? store.arr.map((item,index)=>{
                        return <div key={index}>
                             
                             <Image width='100' height='100' lazyload={true} src={item.img} errorIcon={<div style={{ fontSize: 14 }}>加载失败</div>} />
                             <span>{item.tit}</span>
                        </div>
                      }):""
  				}						
  			</Luo>
  		</div>
  )
}

export default Home